// vite.config.js
import {defineConfig} from 'vite'
import uni from '@dcloudio/vite-plugin-uni' //官方内置的,不用下载,下面代码粘贴直接用即可
 
export default defineConfig({
  plugins: [
    uni()
  ],
  server: {
    port: 5179,//端口号
    proxy: {
      '/api': {
        target: 'http://localhost:7788', // 目标服务  
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, ''),
      }
    }
  }
})